﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="FeedBackPage.aspx.cs" Inherits="GtsServer.Manage.IISPage.Page.FeedBack.FeedBackPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Content/Jquery/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <link href="../../Content/css/Pager.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../../Content/Jquery/pager.js" type="text/javascript"></script>
    <script type="text/javascript">
        var pageSize = 15;
        $(document).ready(function () {
            $("#txtIMSI").focus(function () {
                if ($(this).val() == "输入IMSI查询") {
                    $(this).val("");
                }
            })

            $("#txtIMSI").blur(function () {
                if ($(this).val() == "") {
                    $(this).val($(this).attr("default"));
                }

            })

            $("#txtAccount").focus(function () {
                if ($(this).val() == "输入用户系统账号") {
                    $(this).val("");
                }
            })

            $("#txtAccount").blur(function () {
                if ($(this).val() == "") {
                    $(this).val($(this).attr("default"));
                }

            })

            $("#btnSele").click(function () {
                PageClickFunc(1);
            })

            PageClickFunc(1);
            function PageClickFunc(pageclickednumber) {
                var IMSI = $("#txtIMSI").val() == $("#txtIMSI").attr("default") ? "" : $("#txtIMSI").val();
                var userAccount = $("#txtAccount").val() == $("#txtAccount").attr("default") ? "" : $("#txtAccount").val();
                var StartTime = $("#txtStateTime").val();
                var EndTime = $("#txtEndTime").val();

                $.ajax({
                    type: "post",
                    data: { action: "GetList", pageIndex: pageclickednumber, pageSize: pageSize, imsi: IMSI, userAccount: userAccount, startTime: StartTime, endTime: EndTime },
                    dataType: "json",
                    url: "../../Ajax/FeedBackAjax.ashx",
                    beforeSend: function () {
                    },
                    success: function (data) {
                        if (data != null) {
                            var json = data.json;
                            var tbody = "";
                            var pageCount = data.flag;
                            $("#lblUserIMSI").attr("accesskey", data.userID);
                            $.each(json, function (k, v) {
                                tbody += "<tr id='" + v.Id + "'>"
                                tbody += "<td><lable >";
                                tbody += v.IMSI;
                                tbody += "</lable></td>";
                                tbody += "<td><lable >";
                                tbody += v.IMEI;
                                tbody += "</lable></td>";
                                tbody += "<td><lable>";
                                tbody += v.Mac;
                                tbody += "</lable></td>";
                                tbody += "<td><lable>";
                                tbody += v.UserAccount;
                                tbody += "</lable></td>";
                                tbody += "<td><lable >";
                                tbody += v.UserName;
                                tbody += "</lable></td>";
                                tbody += "<td><lable>";
                                tbody += decodeURIComponent(v.ContactWay);
                                tbody += "</lable></td>";
                                tbody += "<td><lable>";
                                tbody += decodeURIComponent(v.FeedBackContent);
                                tbody += "</lable></td>";
                                tbody += "<td><lable>";
                                tbody += v.RequestTime;
                                tbody += "</lable></td>";
                                tbody += "</tr>"
                            })
                            $("#tb1").empty().append(tbody);
                            $("#pager").pager({ pagenumber: pageclickednumber, pagecount: Math.ceil(pageCount / pageSize), buttonClickCallback: PageClickFunc });

                        }
                    },
                    complete: function () {
                    },
                    error: function () {
                    }
                })
            }
        })
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <input type="text" id="txtIMSI" value="输入IMSI查询" default='输入IMSI查询' />
        <input type="text" id="txtAccount" value="输入用户系统账号" default='输入用户系统账号' />
        <input type="text" id="txtStateTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
            class="Wdate" />
        <input type="text" id="txtEndTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
            class="Wdate" />
        <input type="button" id="btnSele" value="搜索" />
        <table border="1">
            <thead>
                <tr>
                    <td>
                        Imsi
                    </td>
                    <td>
                        Imei
                    </td>
                    <td>
                        Mac
                    </td>
                    <td>
                        系统账号
                    </td>
                    <td>
                        用户名
                    </td>
                    <td>
                        联系方式
                    </td>
                    <td>
                        反馈内容
                    </td>
                    <td>
                        反馈时间
                    </td>
                </tr>
            </thead>
            <tbody id="tb1">
            </tbody>
        </table>
        <div id="pager" style="float: right;">
        </div>
    </div>
</asp:Content>
